package com.lhj.demo.simple.controller;


import com.lhj.demo.simple.service.TestOneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hj.luo
 * @Date 2023-07-10 17:44
 * @descripition
 * @version: 1.0
 */
@RestController
@RequestMapping("/app")
public class TestController {
    @Autowired
    TestOneService testOneService;

    @GetMapping("/test")
    public String test(@RequestParam("id") Integer id, @RequestParam("type")  String type) {
        switch (type) {
            case "not-and-has":
                testOneService.saveNotWithHas(id);
                break;
            default:
                testOneService.saveDB(id);
        }

        return "";
    }
}
